7-5 Days alive and free of invasive or non-invasive ventilation

This outcome was defined as the number of days alive and free of invasive or non-invasive ventilation from randomisation to 28 days. All patients dying within 28 days will be assigned zero free days.

Authors
Affiliations

James Totterdell

University of Sydney

Rob Mahar

University of Melbourne

Published

July 26, 2023

Load packages
library(ASCOTr)
library(tidyverse)
library(lubridate)
library(kableExtra)
library(patchwork)
library(cmdstanr)
library(posterior)
library(bayesplot)
library(ggdist)
library(lme4)
library(broom)
library(broom.mixed)
library(bayestestR)

theme_set(theme_classic(base_size = 10, base_family = "Palatino") +
  theme(panel.grid = element_blank(),
        strip.background = element_blank()))

bayesplot_theme_set(theme_set(theme_classic(base_size = 10, base_family = "Palatino") +
  theme(panel.grid = element_blank(),
        strip.background = element_blank())))

color_scheme_set("red")
options(digits = 4)
Prepare datasets
all_data <- readRDS(file.path(ASCOT_DATA, "all_data.rds"))

# FAS-ITT
fas_itt_dat <- ASCOTr:::make_fas_itt_set(all_data)
fas_itt_nona_dat <- fas_itt_dat |>
  filter(!is.na(out_dafv))

# ACS-ITT
acs_itt_dat <- ASCOTr:::make_acs_itt_set(all_data)
acs_itt_nona_dat <- acs_itt_dat |>
  filter(!is.na(out_dafv))

# AVS-ITT
avs_itt_dat <- ASCOTr:::make_avs_itt_set(all_data)
avs_itt_nona_dat <- avs_itt_dat |>
  filter(!is.na(out_dafv))
Load models
ordmod0 <- compile_cmdstanr_mod(
  file.path("ordinal", "logistic_cumulative"), dir = "stan")
ordmod <- compile_cmdstanr_mod(
  file.path("ordinal", "logistic_cumulative_epoch_site"), dir = "stan")
ordmod_site <- compile_cmdstanr_mod(
  file.path("ordinal", "logistic_cumulative_site"), dir = "stan")
logistic <- compile_cmdstanr_mod(
  file.path("binary", "logistic_site_epoch"), dir = "stan")
Functions
make_summary_table_anticoagulation <- function(dat, format = "html") {
  tdat <- dat %>%
    group_by(CAssignment = factor(
      CAssignment, 
      levels = c("C0", "C1", "C2", "C3", "C4"),
      labels = intervention_labels2()$CAssignment)) %>%
    summarise(
      Patients = n(),
      Known = sum(!is.na(out_dafv)),
      Deaths = sprintf("%i (%.0f%%)", sum(D28_death, na.rm = TRUE), 100 * mean(D28_death, na.rm = TRUE)),
      `Any ventilation` = sprintf("%i (%.0f%%)", 
                                  sum(D28_OutcomeDaysFreeOfVentilation < 28, na.rm = TRUE),
                                  100 * mean(D28_OutcomeDaysFreeOfVentilation < 28, na.rm = TRUE)),
      `DAFV, Median (Q1, Q3)` = sprintf(
        "%.0f (%.0f, %.0f)", 
        median(out_dafv, na.rm = T), 
        quantile(out_dafv, 0.25, na.rm = TRUE), 
        quantile(out_dafv, 0.75, na.rm = TRUE))
    ) %>%
    bind_rows(
      dat %>%
    group_by(CAssignment = "Overall") %>%
    summarise(
      Patients = n(),
      Known = sum(!is.na(out_dafv)),
      Deaths = sprintf("%i (%.0f%%)", sum(D28_death, na.rm = TRUE), 100 * mean(D28_death, na.rm = TRUE)),
      `Any ventilation` = sprintf("%i (%.0f%%)", 
                              sum(D28_OutcomeDaysFreeOfVentilation < 28, na.rm = TRUE),
                              100 * mean(D28_OutcomeDaysFreeOfVentilation < 28, na.rm = TRUE)),
      `DAFV, Median (Q1, Q3)` = sprintf(
        "%.0f (%.0f, %.0f)", 
        median(out_dafv, na.rm = T), 
        quantile(out_dafv, 0.25, na.rm = TRUE), 
        quantile(out_dafv, 0.75, na.rm = TRUE))
    )
    ) %>%
    rename(`Anticoagulation\nintervention` = CAssignment)
  kable(
    tdat,
    format = format,
    align = "lrrrrr",
    booktabs = TRUE,
    linesep = ""
  ) %>%
    kable_styling(
      font_size = 9,
      latex_options = "HOLD_position"
    ) %>%
    row_spec(nrow(tdat), bold = T)
}

make_summary_table_antiviral <- function(dat, format = "html") {
  tdat <- dat %>%
    group_by(AAssignment = factor(
      AAssignment, 
      levels = c("A0", "A1", "A2"),
      labels = intervention_labels2()$AAssignment)) %>%
    summarise(
      Patients = n(),
      Known = sum(!is.na(out_dafv)),
      Deaths = sprintf("%i (%.0f%%)", sum(D28_death, na.rm = TRUE), 100 * mean(D28_death, na.rm = TRUE)),
      `Any ventilation` = sprintf("%i (%.0f%%)", 
                                  sum(D28_OutcomeDaysFreeOfVentilation < 28, na.rm = TRUE),
                                  100 * mean(D28_OutcomeDaysFreeOfVentilation < 28, na.rm = TRUE)),
      `DAFV, Median (Q1, Q3)` = sprintf(
        "%.0f (%.0f, %.0f)", 
        median(out_dafv, na.rm = T), 
        quantile(out_dafv, 0.25, na.rm = TRUE), 
        quantile(out_dafv, 0.75, na.rm = TRUE))
    ) %>%
    bind_rows(
      dat %>%
    group_by(AAssignment = "Overall") %>%
    summarise(
      Patients = n(),
      Known = sum(!is.na(out_dafv)),
      Deaths = sprintf("%i (%.0f%%)", sum(D28_death, na.rm = TRUE), 100 * mean(D28_death, na.rm = TRUE)),
      `Any ventilation` = sprintf("%i (%.0f%%)", 
                              sum(D28_OutcomeDaysFreeOfVentilation < 28, na.rm = TRUE),
                              100 * mean(D28_OutcomeDaysFreeOfVentilation < 28, na.rm = TRUE)),
      `DAFV, Median (Q1, Q3)` = sprintf(
        "%.0f (%.0f, %.0f)", 
        median(out_dafv, na.rm = T), 
        quantile(out_dafv, 0.25, na.rm = TRUE), 
        quantile(out_dafv, 0.75, na.rm = TRUE))
    )
    ) %>%
    rename(`Antiviral\nintervention` = AAssignment)
  kable(
    tdat,
    format = format,
    align = "lrrrrr",
    booktabs = TRUE,
    linesep = ""
  ) %>%
    kable_styling(
      font_size = 9,
      latex_options = "HOLD_position"
    ) %>%
    row_spec(nrow(tdat), bold = T)
}

Outcome Derivation

This outcome was defined as the number of days alive and free of positive pressure ventilation (invasive or non-invasive) to 28 days. All patients dying within 28 days will be assigned zero free days.

The outcome is calculated for a patient as:

  • missing, if day 28 mortality is unknown (D28_PatientStatus) or if the patient was known to have been alive at day 28 but number of days requiring ventilation (D28_OutcomeDaysFreeOfVentilation) is unknown
  • 0 if they died by day 28 (D28_PatientStatus)
  • min(28, D28_OutcomeDaysFreeOfVentilation) otherwise

Descriptive

The overall distribution of days alive and free of ventilation (DAFV) are reported in Figure 1 for all participants in the ACS-ITT set.

There were few participants who required any ventilation during hospital who did not die (DAFV of 0),

Code
pdat <- fas_itt_nona_dat %>%
  dplyr::count(dafv = ordered(out_dafv, levels = 0:28), .drop = F) %>%
  mutate(p = n / sum(n))
p <- ggplot(pdat, aes(dafv, p)) +
  geom_col() +
  labs(
    x = "Days alive and free of ventilation", 
    y = "Proportion"
  )
path <- file.path("outputs", "figures", "outcomes", "secondary")
ggsave(file.path(path, "outcome-7-5-dist-overall.pdf"), p, height = 2.5, width = 6)
p

(a) FAS-ITT
Figure 1: Distribution of days alive and free of ventilation

Anticoagulation

Summary of DAFH outcome by arm
save_tex_table(
  make_summary_table_anticoagulation(fas_itt_dat, "latex"), 
  file.path("outcomes", "secondary", "7-5-anticoagulation-summary"))
make_summary_table_anticoagulation(fas_itt_dat)
Anticoagulation intervention Patients Known Deaths Any ventilation DAFV, Median (Q1, Q3)
Not randomised to anticoagulation 32 26 0 (0%) 4 (15%) 28 (28, 28)
Low-dose 610 598 19 (3%) 34 (6%) 28 (28, 28)
Intermediate-dose 613 606 15 (2%) 23 (4%) 28 (28, 28)
Low-dose with aspirin 283 281 10 (4%) 18 (6%) 28 (28, 28)
Therapeutic-dose 50 50 6 (12%) 7 (14%) 28 (28, 28)
Overall 1588 1561 50 (3%) 86 (6%) 28 (28, 28)
Table 1: Summary of days alive and free of ventilation to day 28 by anticoagulation treatment group, FAS-ITT.
Code
pdat <- fas_itt_nona_dat %>%
  dplyr::count(
    CAssignment = factor(CAssignment, labels = str_replace(intervention_labels()$CAssignment, "<br>", "\n")),
    dafv = ordered(out_dafv, levels = 0:28), 
    .drop = F) %>%
  group_by(CAssignment) %>%
  mutate(p = n / sum(n)) %>%
  mutate(cp = cumsum(p)) %>%
  ungroup()
p <- ggplot(pdat, aes(CAssignment, p)) +
  geom_col(aes(fill = fct_rev(dafv))) +
  labs(x = "Anticoagulation intervention", y = "Cumulative proportion") +
  scale_fill_viridis_d("Days alive and\nfree of ventilation", option = "A", direction = -1) +
  guides(fill = guide_legend(reverse = TRUE)) +
  theme(legend.key.size = unit(0.75, "lines"))
pth <- file.path("outputs", "figures", "outcomes", "secondary")
ggsave(file.path(pth, "outcome-7-5-descriptive-anticoagulation.pdf"), p, height = 3, width = 6)
p

Figure 2: Distribution of days alive and free of hospital by anti-coagulation intervention.
Code
pdat <- avs_itt_nona_dat %>%
  dplyr::count(
    CAssignment = factor(CAssignment, labels = str_replace(intervention_labels()$CAssignment, "<br>", "\n")),
    dafv = ordered(out_dafv, levels = 0:28), 
    .drop = F) %>%
  group_by(CAssignment) %>%
  mutate(p = n / sum(n)) %>%
  mutate(cp = cumsum(p)) %>%
  ungroup()
p <- ggplot(pdat, aes(CAssignment, p)) +
  geom_col(aes(fill = fct_rev(dafv))) +
  labs(x = "Anticoagulation intervention", y = "Cumulative proportion") +
  scale_fill_viridis_d("Days alive and\nfree of ventilation", option = "A", direction = -1) +
  guides(fill = guide_legend(reverse = TRUE)) +
  theme(legend.key.size = unit(0.75, "lines"))
pth <- file.path("outputs", "figures", "outcomes", "secondary")
ggsave(file.path(pth, "outcome-7-5-descriptive-anticoagulation-avs-itt.pdf"), p, height = 3, width = 6)
p

Figure 3: Distribution of days alive and free of hospital by anti-coagulation intervention.

Antiviral

Summary of DAFH outcome by arm
save_tex_table(
  make_summary_table_antiviral(fas_itt_dat, "latex"), 
  file.path("outcomes", "secondary", "7-5-antiviral-summary"))
make_summary_table_antiviral(fas_itt_dat)
Antiviral intervention Patients Known Deaths Any ventilation DAFV, Median (Q1, Q3)
Not randomised to antiviral 1433 1414 50 (4%) 74 (5%) 28 (28, 28)
Standard of care 73 68 0 (0%) 8 (12%) 28 (28, 28)
Nafamostat 82 79 0 (0%) 4 (5%) 28 (28, 28)
Overall 1588 1561 50 (3%) 86 (6%) 28 (28, 28)
Table 2: Summary of days alive and free of ventilation to day 28 by antiviral treatment group, FAS-ITT.
Code
pdat <- fas_itt_nona_dat %>%
  dplyr::count(
    AAssignment = factor(AAssignment, labels = str_replace(intervention_labels()$AAssignment, "<br>", "\n")),
    dafv = ordered(out_dafv, levels = 0:28), 
    .drop = F) %>%
  group_by(AAssignment) %>%
  mutate(p = n / sum(n)) %>%
  mutate(cp = cumsum(p)) %>%
  ungroup()
p <- ggplot(pdat, aes(AAssignment, p)) +
  geom_col(aes(fill = fct_rev(dafv))) +
  labs(x = "Antiviral intervention", y = "Cumulative proportion") +
  scale_fill_viridis_d("Days alive and\nfree of ventilation", option = "A", direction = -1) +
  guides(fill = guide_legend(reverse = TRUE)) +
  theme(legend.key.size = unit(0.75, "lines"))
pth <- file.path("outputs", "figures", "outcomes", "secondary")
ggsave(file.path(pth, "outcome-7-5-descriptive-antiviral.pdf"), p, height = 3, width = 6)
p

Figure 4: Distribution of days alive and free of hospital by antiviral intervention.
Code
pdat <- avs_itt_nona_dat %>%
  dplyr::count(
    AAssignment = factor(AAssignment, labels = c("Usual care", "Nafamostat")),
    dafv = ordered(out_dafv, levels = 0:28), 
    .drop = F) %>%
  group_by(AAssignment) %>%
  mutate(p = n / sum(n)) %>%
  mutate(cp = cumsum(p)) %>%
  ungroup()
p <- ggplot(pdat, aes(AAssignment, p)) +
  geom_col(aes(fill = fct_rev(dafv))) +
  labs(x = "Antiviral intervention", y = "Cumulative proportion") +
  scale_fill_viridis_d("Days alive and\nfree of ventilation", option = "A", direction = -1) +
  guides(fill = guide_legend(reverse = TRUE)) +
  theme(legend.key.size = unit(0.6, "lines"))
pth <- file.path("outputs", "figures", "outcomes", "secondary")
fpth <- file.path(pth, "outcome-7-5-descriptive-antiviral-avs-itt.pdf")
ggsave(fpth, p + coord_flip(), height = 2.5, width = 6)
system(sprintf("pdftoppm %s %s -png", fpth, gsub(".pdf", "", fpth)))
p

Figure 5: Distribution of days alive and free of hospital by antiviral intervention.
Code
pdat <- acs_itt_nona_dat %>%
  dplyr::count(
    AAssignment = factor(AAssignment, labels = str_replace(intervention_labels()$AAssignment, "<br>", "\n")),
    dafv = ordered(out_dafv, levels = 0:28), 
    .drop = F) %>%
  group_by(AAssignment) %>%
  mutate(p = n / sum(n)) %>%
  mutate(cp = cumsum(p)) %>%
  ungroup()
p <- ggplot(pdat, aes(AAssignment, p)) +
  geom_col(aes(fill = fct_rev(dafv))) +
  labs(x = "Antiviral intervention", y = "Cumulative proportion") +
  scale_fill_viridis_d("Days alive and\nfree of ventilation", option = "A", direction = -1) +
  guides(fill = guide_legend(reverse = TRUE)) +
  theme(legend.key.size = unit(0.75, "lines"))
pth <- file.path("outputs", "figures", "outcomes", "secondary")
ggsave(file.path(pth, "outcome-7-5-descriptive-antiviral-acs-itt.pdf"), p, height = 3, width = 6)
p

Figure 6: Distribution of days alive and free of hospital by antiviral intervention.

Age

DAFV by age
pdat <- fas_itt_nona_dat %>%
  dplyr::count(
    agegrp = cut(AgeAtEntry, c(18, seq(25, 75, 5), 100), include.lowest = T, right = F),
    dafv = fct_rev(ordered(out_dafv, levels = 0:28)), 
    .drop = F) %>%
  group_by(agegrp) %>%
  mutate(p = n / sum(n))
pdat2 <- pdat %>%
  group_by(agegrp) %>%
  summarise(n = sum(n))
p1 <- ggplot(pdat2, aes(agegrp, n)) +
  geom_col(colour = "grey40", fill = "grey40") +
  geom_vline(xintercept = 60, linetype = 2) +
  labs(y = "Number of\nparticipants",
       x = "Age at entry") +
  geom_vline(xintercept = 8.5, linetype = 2) +
  theme(axis.text.x = element_text(hjust = 1, angle = 45))
p2 <- ggplot(pdat, aes(agegrp, p)) +
  geom_col(aes(fill = dafv)) +
  labs(x = "Age", y = "Cumulative\nproportion") +
  scale_fill_viridis_d("DAFV", option = "A", direction = -1) +
  guides(fill = guide_legend(reverse = TRUE)) +
  geom_vline(xintercept = 8.5, linetype = 2) +
  theme(axis.text.x = element_text(hjust = 1, angle = 45)) +
  theme(legend.key.size = unit(0.25, "lines"))
p <- p1 | p2
path <- file.path("outputs", "figures", "outcomes", "secondary")
ggsave(file.path(path, "7-5-age.pdf"), p, height = 2.5, width = 6)
p

Figure 7: Distribution of days alive and free of ventilation by age group, FAS-ITT.

Sex

DAFV by sex
pdat <- fas_itt_nona_dat %>%
  dplyr::count(
    Sex,
    dafv = ordered(out_dafv, levels = 0:28), 
    .drop = F) %>%
  group_by(Sex) %>%
  mutate(p = n / sum(n)) %>%
  mutate(cp = cumsum(p)) %>%
  ungroup()
pdat2 <- pdat %>%
  group_by(Sex) %>%
  summarise(n = sum(n))
p1 <- ggplot(pdat2, aes(Sex, n)) +
  geom_col() +
    labs(
      y = "Number of\nparticipants")
p2 <- ggplot(pdat, aes(Sex, p)) +
  geom_col(aes(fill = fct_rev(dafv))) +
  labs(x = "Sex", y = "Cumulative\nproportion") +
  scale_fill_viridis_d("DAFV", option = "A", direction = -1) +
  guides(fill = guide_legend(reverse = TRUE)) +
  theme(legend.key.size = unit(0.25, "lines"))
p <- p1 | p2
path <- file.path("outputs", "figures", "outcomes", "secondary")
ggsave(file.path(path, "7-5-sex.pdf"), p, height = 2.5, width = 6)
p

Figure 8: Distribution of days alive and free of ventilation by sex.

Oxygen

DAFV by oxygen
pdat <- fas_itt_nona_dat %>%
  dplyr::count(
    supp_oxy2 = factor(supp_oxy2, labels = c("Not required", "Required")),
    dafv = ordered(out_dafv, levels = 0:28), 
    .drop = F) %>%
  group_by(supp_oxy2) %>%
  mutate(p = n / sum(n)) %>%
  mutate(cp = cumsum(p)) %>%
  ungroup()
pdat2 <- pdat %>%
  group_by(supp_oxy2) %>%
  summarise(n = sum(n))
p1 <- ggplot(pdat2, aes(supp_oxy2, n)) +
  geom_col() +
    labs(
      y = "Number of\nparticipants", 
      x = "Supplemental oxygen")
p2 <- ggplot(pdat, aes(supp_oxy2, p)) +
  geom_col(aes(fill = fct_rev(dafv))) +
  labs(x = "Supplemental oxygen", y = "Cumulative\nproportion") +
  scale_fill_viridis_d("DAFV", option = "A", direction = -1) +
  guides(fill = guide_legend(reverse = TRUE)) +
  theme(legend.key.size = unit(0.25, "lines"))
p <- p1 | p2
path <- file.path("outputs", "figures", "outcomes", "secondary")
ggsave(file.path(path, "7-5-oxygen.pdf"), p, height = 2.5, width = 6)
p

Figure 9: Distribution of days alive and free of ventilation by oxygen.

Country

DAFV by country
pdat <- fas_itt_nona_dat %>%
  dplyr::count(
    Country = fct_infreq(Country),
    dafv = ordered(out_dafv, levels = 0:28), 
    .drop = F) %>%
  group_by(Country) %>%
  mutate(p = n / sum(n)) %>%
  mutate(cp = cumsum(p)) %>%
  ungroup()
pdat2 <- pdat %>%
  group_by(Country) %>%
  summarise(n = sum(n))
p1 <- ggplot(pdat2, aes(Country, n)) +
  geom_col() +
    labs(
      y = "Number of\nparticipants", 
      x = "Country of enrolment")
p2 <- ggplot(pdat, aes(Country, p)) +
  geom_col(aes(fill = fct_rev(dafv))) +
  labs(x = "Country", y = "Cumulative\nproportion") +
  scale_fill_viridis_d("DAFV", option = "A", direction = -1) +
  guides(fill = guide_legend(reverse = TRUE)) +
  theme(legend.key.size = unit(0.25, "lines"))
p <- p1 | p2
path <- file.path("outputs", "figures", "outcomes", "secondary")
ggsave(file.path(path, "7-5-country.pdf"), p, height = 2.5, width = 6)
p

Figure 10: Distribution of days alive and free of ventilation by country.

Site

DAFV by site
pdat <- fas_itt_nona_dat %>%
  dplyr::count(
    Country = factor(PT_CountryName, levels = c("India", "Australia", "Nepal", "New Zealand"),
                     labels = c("India", "Australia", "Nepal", "New\nZealand")),
    Site = fct_infreq(Location),
    dafv = ordered(out_dafv, levels = 0:28)) %>%
  complete(dafv = ordered(0:28), nesting(Country, Site), fill = list(n = 0)) %>%
  group_by(Country, Site) %>%
  mutate(p = n / sum(n)) %>%
  mutate(cp = cumsum(p)) %>%
  ungroup() %>%
  mutate(
    Country = droplevels(Country),
    Site = droplevels(Site)
  )
pdat2 <- pdat %>%
  group_by(Country, Site) %>%
  summarise(n = sum(n)) %>%
  ungroup()
p1 <- ggplot(pdat2, aes(Site, n)) +
  facet_grid( ~ Country, scales = "free_x", space = "free_x") +
  geom_col() +
    labs(
      y = "Number of\nparticipants", 
      x = "") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1),
        panel.border = element_rect(fill = NA))
p2 <- ggplot(pdat, aes(Site, p)) +
  facet_grid( ~ Country, scales = "free_x", space = "free_x") +
  geom_col(aes(fill = fct_rev(dafv))) +
  labs(x = "Study site", y = "Cumulative\nproportion") +
  scale_fill_viridis_d("DAFV", option = "A", direction = -1) +
  guides(fill = guide_legend(reverse = TRUE, ncol = 1)) +
  theme(axis.text.x = element_text(hjust = 1, angle = 45)) +
  theme(legend.key.size = unit(0.25, "lines"))
p <- p1 / p2 +
  plot_layout(guides = 'collect')
path <- file.path("outputs", "figures", "outcomes", "secondary")
ggsave(file.path(path, "7-5-country-site.pdf"), p, height = 4, width = 6.25)
p

Figure 11: Distribution of days alive and free of ventilation by study site

Calendar Time

DAFV by calendar date
pdat <- fas_itt_nona_dat %>%
  dplyr::count(
    yr = year(RandDate), mth = month(RandDate),
    dafv = ordered(out_dafv, levels = 0:28), 
    .drop = F) %>%
  group_by(yr, mth) %>%
  mutate(p = n / sum(n)) %>%
  mutate(cp = cumsum(p)) %>%
  ungroup()
p1 <- pdat %>%
  group_by(yr, mth) %>%
  summarise(n = sum(n)) %>%
  ggplot(., aes(mth, n))  +
  facet_grid( ~ yr, drop = T, scales = "free_x", space = "free") +
    geom_col() +
    labs(
      y = "Number of\nparticipants", 
      x = "Calendar date (month of year)") +
  scale_x_continuous(breaks = 1:12)
p2 <- ggplot(pdat, aes(mth, p)) +
  facet_grid( ~ yr, drop = T, scales = "free_x", space = "free") +
  geom_col(aes(fill = fct_rev(dafv))) +
  labs(x = "Calendar date (month of year)", y = "Cumulative\nproportion") +
  scale_fill_viridis_d("DAFV", option = "A", direction = -1) +
  guides(fill = guide_legend(reverse = TRUE)) +
  theme(legend.key.size = unit(0.25, "lines")) +
  scale_x_continuous(breaks = 1:12)
p <- p1 | p2
path <- file.path("outputs", "figures", "outcomes", "secondary")
ggsave(file.path(path, "7-5-calendar-time.pdf"), p, height = 2, width = 6)
p

Figure 12: Distribution of days alive and free of ventilation by calendar time.

Sample Cumulative Logits

Plot sample cumulative logits
trt_counts <- fas_itt_nona_dat %>%
  dplyr::count(CAssignment, out_dafv) %>%
  complete(CAssignment, out_dafv, fill = list(n = 0)) %>%
  group_by(CAssignment) %>%
  mutate(p = n / sum(n))
trt_logit <- trt_counts %>% 
  group_by(CAssignment) %>% 
  mutate(clogit = logit(cumsum(p))) %>%
  group_by(out_dafv) %>%
  mutate(rel_clogit = clogit - mean(clogit)) %>%
  filter(out_dafv != 28)
ggplot(trt_logit, aes(CAssignment, rel_clogit)) +
  facet_wrap( ~ out_dafv) +
  geom_point() +
  labs(y = "Relative (to mean) sample cumulative logit")

Inspect sample cumulative logits.
Plot sample cumulative logits
ggplot(trt_logit, aes(out_dafv, rel_clogit)) +
  facet_wrap( ~ CAssignment) +
  geom_point() +
  labs(y = "Relative (to mean) sample cumulative logit")

Inspect sample cumulative logits.
Plot sample cumulative logits
trt_counts <- fas_itt_nona_dat %>%
  dplyr::count(AAssignment, out_dafv) %>%
  complete(AAssignment, out_dafv, fill = list(n = 0)) %>%
  group_by(AAssignment) %>%
  mutate(p = n / sum(n))
trt_logit <- trt_counts %>% 
  group_by(AAssignment) %>% 
  mutate(clogit = logit(cumsum(p))) %>%
  group_by(out_dafv) %>%
  mutate(rel_clogit = clogit - mean(clogit)) %>%
  filter(out_dafv != 28)
ggplot(trt_logit, aes(AAssignment, rel_clogit)) +
  facet_wrap( ~ out_dafv) +
  geom_point() +
  labs(y = "Relative (to mean) sample cumulative logit")

Inspect sample cumulative logits.
Plot sample cumulative logits
ggplot(trt_logit, aes(out_dafv, rel_clogit)) +
  facet_wrap( ~ AAssignment) +
  geom_point() +
  labs(y = "Relative (to mean) sample cumulative logit")

Inspect sample cumulative logits.

Modelling

FAS-ITT

Fit primary model
res <- fit_primary_model(
  fas_itt_nona_dat,
  ordmod,
  outcome = "out_dafv",
  intercept = FALSE
)
names(res$drws$AOR) <- "Nafamostat"
names(res$drws$COR) <- intervention_labels2()$CAssignment[-(1:2)]
names(res$drws$OR) <- c("Ineligible aspirin", "Age \u2265 60", "Female", "Oxygen requirement", "Australia/New Zealand", "Nepal")
Odds ratio summary table
save_tex_table(
  odds_ratio_summary_table_rev(c(res$drws$AOR, res$drws$COR, res$drws$OR), "latex"),
  "outcomes/secondary/7-5-primary-model-fas-itt-summary-table")
odds_ratio_summary_table_rev(c(res$drws$AOR, res$drws$COR, res$drws$OR))
Parameter Median 95% CrI Mean (SD) Pr(OR > 1)
Nafamostat 2.52 (0.77, 8.80) 3.11 (2.22) 0.94
Intermediate-dose 1.48 (0.84, 2.63) 1.54 (0.46) 0.91
Low-dose with aspirin 1.19 (0.63, 2.29) 1.26 (0.43) 0.70
Therapeutic-dose 0.34 (0.12, 0.95) 0.39 (0.22) 0.02
Ineligible aspirin 0.31 (0.10, 1.19) 0.39 (0.30) 0.04
Age ≥ 60 0.53 (0.32, 0.87) 0.55 (0.14) 0.01
Female 1.81 (1.11, 3.02) 1.88 (0.50) 0.99
Oxygen requirement 0.26 (0.15, 0.45) 0.27 (0.08) 0.00
Australia/New Zealand 1.11 (0.29, 4.55) 1.45 (1.20) 0.56
Nepal 0.73 (0.20, 2.98) 0.95 (0.78) 0.32
Posterior summaries for model parameters (fixed-effects).
Code
p <- plot_or_densities(c(res$drws$AOR, res$drws$COR)) +
  labs(x = "Odds ratio (log scale)", y = "Comparison")
pth <- file.path("outputs", "figures", "outcomes", "primary", "7-5-primary-model-fas-itt-odds-ratio-densities.pdf")
ggsave(pth, p, width = 6, height = 2.5)
p

Figure 13: Posterior densities for odds ratio contrasts.
Odds ratio summary for epoch and site
p <- plot_epoch_site_terms(
  res$drws$gamma_epoch,
  res$drws$gamma_site,
  factor(res$dat$region_by_site, 
         labels = c("India", "Australia\nNew Zealand", "Nepal"))
)
pth <- file.path("outputs", "figures", "outcomes", "secondary", "7-5-primary-model-fas-itt-epoch-site-terms.pdf")
ggsave(pth, p, width = 6, height = 4.5)
p

Summary of epoch and site posterior odds ratios.
Code
res$fit$summary(c("alpha", "beta", "gamma_site", "gamma_epoch", "tau_site", "tau_epoch")) %>%
  print(n = Inf)
# A tibble: 74 × 10
   variable            mean   median    sd   mad      q5     q95  rhat ess_bulk
   <chr>              <num>    <num> <num> <num>   <num>   <num> <num>    <num>
 1 alpha[1]        -4.49    -4.49    0.769 0.733 -5.74   -3.22    1.00    2085.
 2 alpha[2]        -4.44    -4.45    0.768 0.736 -5.69   -3.17    1.00    2074.
 3 alpha[3]        -4.42    -4.42    0.768 0.737 -5.67   -3.15    1.00    2073.
 4 alpha[4]        -4.39    -4.40    0.768 0.737 -5.64   -3.13    1.00    2066.
 5 alpha[5]        -4.37    -4.38    0.768 0.737 -5.62   -3.11    1.00    2063.
 6 alpha[6]        -4.35    -4.35    0.768 0.736 -5.60   -3.08    1.00    2060.
 7 alpha[7]        -4.31    -4.31    0.768 0.735 -5.56   -3.04    1.00    2053.
 8 alpha[8]        -4.29    -4.29    0.768 0.733 -5.53   -3.02    1.00    2048.
 9 alpha[9]        -4.27    -4.27    0.767 0.733 -5.52   -3.00    1.00    2042.
10 alpha[10]       -4.23    -4.23    0.767 0.734 -5.48   -2.96    1.00    2039.
11 alpha[11]       -4.19    -4.19    0.767 0.735 -5.44   -2.93    1.00    2035.
12 alpha[12]       -4.17    -4.17    0.767 0.734 -5.42   -2.91    1.00    2031.
13 alpha[13]       -4.13    -4.14    0.766 0.734 -5.38   -2.87    1.00    2026.
14 alpha[14]       -4.10    -4.10    0.766 0.734 -5.35   -2.83    1.00    2023.
15 alpha[15]       -4.06    -4.07    0.765 0.732 -5.31   -2.80    1.00    2018.
16 alpha[16]       -3.99    -3.99    0.765 0.732 -5.23   -2.72    1.00    2015.
17 alpha[17]       -3.91    -3.92    0.764 0.730 -5.15   -2.65    1.00    2009.
18 alpha[18]       -3.85    -3.86    0.764 0.730 -5.10   -2.59    1.00    2006.
19 beta[1]          0.260    0.260   0.634 0.634 -0.786   1.30    1.00   13400.
20 beta[2]          0.662    0.654   0.439 0.434 -0.0495  1.39    1.00   24671.
21 beta[3]         -0.478   -0.490   0.621 0.616 -1.48    0.565   1.00   20451.
22 beta[4]         -0.899   -0.895   0.414 0.413 -1.58   -0.221   1.00   18678.
23 beta[5]          0.143    0.143   0.232 0.235 -0.235   0.526   1.00   19197.
24 beta[6]          0.655    0.654   0.279 0.280  0.201   1.11    1.00   18551.
25 beta[7]         -1.14    -1.16    0.638 0.625 -2.16   -0.0681  1.00   24492.
26 beta[8]         -0.638   -0.639   0.250 0.246 -1.05   -0.225   1.00   21798.
27 beta[9]          0.598    0.593   0.258 0.257  0.184   1.03    1.00   24732.
28 beta[10]        -1.33    -1.33    0.270 0.267 -1.78   -0.889   1.00   20193.
29 beta[11]         0.120    0.104   0.703 0.700 -1.02    1.29    1.00    8159.
30 beta[12]        -0.294   -0.309   0.681 0.670 -1.38    0.849   1.00    5865.
31 gamma_site[1]    1.88     1.62    1.60  1.35  -0.202   4.79    1.00    9394.
32 gamma_site[2]    2.50     2.23    1.56  1.28   0.515   5.35    1.00    8394.
33 gamma_site[3]    1.46     1.21    1.70  1.45  -0.793   4.55    1.00   11660.
34 gamma_site[4]   -1.50    -1.51    0.631 0.614 -2.52   -0.470   1.00    3987.
35 gamma_site[5]   -0.158   -0.172   0.612 0.590 -1.14    0.863   1.00    3579.
36 gamma_site[6]   -1.36    -1.36    0.644 0.628 -2.42   -0.304   1.00    4997.
37 gamma_site[7]    2.78     2.53    1.53  1.28   0.832   5.56    1.00    7172.
38 gamma_site[8]   -0.739   -0.742   0.723 0.698 -1.90    0.452   1.00    5714.
39 gamma_site[9]    1.40     1.34    0.865 0.831  0.0876  2.90    1.00    6173.
40 gamma_site[10]   2.16     1.91    1.55  1.33   0.162   4.98    1.00    9124.
41 gamma_site[11]  -0.619   -0.630   0.673 0.648 -1.72    0.498   1.00    4532.
42 gamma_site[12]  -0.153   -0.0982  0.804 0.675 -1.53    1.12    1.00   23101.
43 gamma_site[13]   0.595    0.415   0.976 0.766 -0.678   2.40    1.00   19852.
44 gamma_site[14]  -0.776   -0.659   0.882 0.864 -2.38    0.433   1.00   12916.
45 gamma_site[15]  -0.102   -0.0691  0.793 0.671 -1.43    1.18    1.00   23857.
46 gamma_site[16]  -0.919   -0.798   0.929 0.951 -2.62    0.336   1.00   11940.
47 gamma_site[17]  -1.16    -1.11    0.808 0.847 -2.59    0.0105  1.00    9461.
48 gamma_site[18]   0.411    0.242   1.03  0.751 -0.998   2.28    1.00   23855.
49 gamma_site[19]   0.290    0.159   1.04  0.786 -1.23    2.14    1.00   23284.
50 gamma_site[20]  -0.258   -0.183   0.852 0.707 -1.73    1.07    1.00   21907.
51 gamma_site[21]   0.355    0.202   1.03  0.786 -1.08    2.19    1.00   23076.
52 gamma_site[22]   0.505    0.340   1.02  0.790 -0.881   2.37    1.00   20782.
53 gamma_site[23]   0.659    0.478   1.01  0.778 -0.633   2.52    1.00   17505.
54 gamma_site[24]   0.383    0.308   0.732 0.620 -0.723   1.67    1.00   22005.
55 gamma_site[25]   0.508    0.329   1.02  0.782 -0.891   2.38    1.00   20594.
56 gamma_site[26]  -0.161   -0.0650  0.512 0.311 -1.12    0.559   1.00   14051.
57 gamma_site[27]   0.0465   0.0176  0.518 0.308 -0.785   0.914   1.00   16220.
58 gamma_epoch[1]   0        0       0     0      0       0      NA         NA 
59 gamma_epoch[2]   0.254    0.133   0.487 0.319 -0.347   1.20    1.00    6299.
60 gamma_epoch[3]  -0.00913 -0.00845 0.514 0.380 -0.842   0.852   1.00    6206.
61 gamma_epoch[4]   0.0833   0.0232  0.556 0.420 -0.757   1.10    1.00    5417.
62 gamma_epoch[5]  -0.0526  -0.0451  0.556 0.440 -0.961   0.892   1.00    5652.
63 gamma_epoch[6]  -0.259   -0.200   0.573 0.471 -1.26    0.621   1.00    6000.
64 gamma_epoch[7]  -0.0998  -0.0911  0.604 0.495 -1.06    0.938   1.00    5896.
65 gamma_epoch[8]  -0.125   -0.108   0.617 0.505 -1.13    0.913   1.00    5770.
66 gamma_epoch[9]  -0.160   -0.144   0.639 0.522 -1.19    0.924   1.00    5616.
67 gamma_epoch[10] -0.502   -0.438   0.636 0.607 -1.63    0.421   1.00    5362.
68 gamma_epoch[11] -0.524   -0.456   0.654 0.631 -1.68    0.418   1.00    5388.
69 gamma_epoch[12] -0.157   -0.145   0.693 0.578 -1.28    1.02    1.00    5559.
70 gamma_epoch[13]  0.111    0.0210  0.775 0.638 -1.04    1.53    1.00    6153.
71 tau_site[1]      1.95     1.80    0.766 0.613  1.04    3.38    1.00    5538.
72 tau_site[2]      1.01     0.954   0.552 0.514  0.202   1.98    1.00    6098.
73 tau_site[3]      0.599    0.443   0.581 0.420  0.0378  1.68    1.00   10970.
74 tau_epoch        0.401    0.363   0.263 0.251  0.0457  0.890   1.00    4987.
# ℹ 1 more variable: ess_tail <num>
Code
res$fit$diagnostic_summary()
$num_divergent
[1] 0 0 0 0 0 0 0 0

$num_max_treedepth
[1] 0 0 0 0 0 0 0 0

$ebfmi
[1] 0.8033 0.8003 0.7954 0.7891 0.8748 0.7587 0.7734 0.7947
Code
mcmc_trace(res$drws["beta"])

Code
mcmc_trace(res$drws["alpha"])

Code
mcmc_trace(res$drws["gamma_site"])

Code
mcmc_trace(res$drws["gamma_epoch"])

Posterior Predictive

Code
y_raw <- as.integer(levels(res$dat$y_raw))
y_ppc <- res$drws$y_ppc
y_ppc_raw <- rfun(\(x) y_raw[x])(y_ppc)
ppc_dat <- bind_cols(fas_itt_nona_dat, tibble(y_ppc = y_ppc_raw))
grp_ppc <- function(grp, d = 0:27) {
  ppc_dat %>%
    group_by(grp = {{grp}}) %>%
    summarise(
      y_lteq = map_dbl(d, ~ mean(out_dafv <= .x)),
      ypp_lteq = map(d, ~ rvar_mean(y_ppc <= .x)),
      y_eq = map_dbl(d, ~ mean(out_dafv == .x)),
      ypp_eq = map(d, ~ rvar_mean(y_ppc == .x))
    ) %>%
    unnest(c(ypp_lteq, ypp_eq)) %>%
    mutate(days = d) %>%
    ungroup() %>%
    pivot_longer(
      y_lteq:ypp_eq, 
      names_to = c("response", "event"),
      names_sep = "_",
      values_to = "posterior")
}
plot_grp_ppc <- function(dat, lab = "", xlab = "Probability") {
  ggplot(dat %>% 
           filter(response == "ypp", event == "eq"), 
         aes(y = days)) +
    facet_wrap( ~ grp, nrow = 1, scales = "free_x") +
    stat_slabinterval(aes(xdist = posterior), fatten_point = 1)  +
    geom_point(data = dat %>% filter(response == "y", event == "eq"), 
               aes(y = days, x = mean(posterior)),
               colour = "red",
               shape = 23) +
    scale_x_continuous(
      xlab, breaks = c(0, 0.3, 0.6),
      sec.axis = sec_axis(
        ~ . , name = lab, breaks = NULL, labels = NULL)) +
    scale_y_continuous("Days") +
    theme(strip.text = element_text(size = rel(0.7)),
          axis.title.x = element_text(size = rel(0.7)),
          axis.text.x = element_text(size = rel(0.65)),
          axis.title.y = element_text(size = rel(0.75)),
          axis.title.x.bottom = element_blank())
}
pp_A <- grp_ppc(AAssignment)
pp_C <- grp_ppc(CAssignment)
pp_ctry <- grp_ppc(Country)
pp_epoch <- grp_ppc(epoch)
pp_site <- grp_ppc(site) %>%
  left_join(ppc_dat %>% dplyr::count(site, Country), 
            by = c("grp" = "site"))
p0 <- plot_grp_ppc(pp_A, "Antiviral", "")
p1 <- plot_grp_ppc(pp_C, "Anticoagulation", "")
p2 <- plot_grp_ppc(pp_ctry, "Country", "") 
p3 <- plot_grp_ppc(pp_epoch, "Epoch", "")
p4 <- plot_grp_ppc(
  pp_site %>% filter(Country == "IN"), "Sites India", "")
p5 <- plot_grp_ppc(
  pp_site %>% filter(Country == "AU"), "Sites Australia", "")
p6 <- plot_grp_ppc(
  pp_site %>% filter(Country == "NP"), "Sites Nepal", "")
p7 <- plot_grp_ppc(
  pp_site %>% filter(Country == "NZ"), "Sites New Zealand", "")
g1 <- (p0 | p1 | p2) / p3
g2 <- p4 / p5 / (p6 | p7)
pth1 <- file.path(
  "outputs", "figures", "outcomes", "secondary",
  "7-5-primary-model-fas-itt-ppc1.pdf")
pth2 <- file.path(
  "outputs", "figures", "outcomes", "secondary",
  "7-5-primary-model-fas-itt-ppc2.pdf")
ggsave(pth1, g1, width = 6, height = 5, device = cairo_pdf)
ggsave(pth2, g2, width = 6, height = 6, device = cairo_pdf)
g1

Code
g2

ACS-ITT

Fit primary model
res <- fit_primary_model(
  acs_itt_nona_dat,
  ordmod,
  outcome = "out_dafv",
  intercept = FALSE
)
names(res$drws$AOR) <- "Nafamostat"
names(res$drws$COR) <- intervention_labels2()$CAssignment[-(1:2)]
names(res$drws$OR) <- c("Ineligible aspirin", "Age \u2265 60", "Female", "Oxygen requirement", "Australia/New Zealand", "Nepal")
Odds ratio summary table
save_tex_table(
  odds_ratio_summary_table_rev(c(res$drws$AOR, res$drws$COR, res$drws$OR), "latex"),
  "outcomes/secondary/7-5-primary-model-acs-itt-summary-table")
odds_ratio_summary_table_rev(c(res$drws$AOR, res$drws$COR, res$drws$OR))
Parameter Median 95% CrI Mean (SD) Pr(OR > 1)
Nafamostat 3.82 (0.93, 17.34) 5.17 (4.74) 0.97
Intermediate-dose 1.49 (0.85, 2.66) 1.56 (0.46) 0.92
Low-dose with aspirin 1.19 (0.63, 2.32) 1.27 (0.44) 0.70
Therapeutic-dose 0.34 (0.12, 1.03) 0.40 (0.24) 0.03
Ineligible aspirin 0.28 (0.08, 1.07) 0.35 (0.28) 0.03
Age ≥ 60 0.53 (0.32, 0.88) 0.55 (0.14) 0.01
Female 1.82 (1.11, 3.13) 1.90 (0.52) 0.99
Oxygen requirement 0.26 (0.15, 0.44) 0.27 (0.07) 0.00
Australia/New Zealand 1.42 (0.35, 6.14) 1.88 (1.70) 0.68
Nepal 0.68 (0.19, 2.75) 0.88 (0.72) 0.29
Posterior summaries for model parameters (fixed-effects).
Code
p <- plot_or_densities(c(res$drws$AOR, res$drws$COR)) +
  labs(x = "Odds ratio (log scale)", y = "Comparison")
pth <- file.path("outputs", "figures", "outcomes", "primary", "7-5-primary-model-acs-itt-odds-ratio-densities.pdf")
ggsave(pth, p, width = 6, height = 2.5)
p

Figure 14: Posterior densities for odds ratio contrasts.
Odds ratio summary for epoch and site
p <- plot_epoch_site_terms(
  exp(res$drws$gamma_epoch),
  exp(res$drws$gamma_site),
  factor(res$dat$region_by_site, 
         labels = c("India", "Australia\nNew Zealand", "Nepal"))
)
pth <- file.path("outputs", "figures", "outcomes", "secondary", "7-5-primary-model-acs-itt-epoch-site-terms.pdf")
ggsave(pth, p, width = 6, height = 4.5)
p

Summary of epoch and site posterior odds ratios.

AVS-ITT

Pre-specified

Fit primary model
res <- fit_primary_model(
  avs_itt_nona_dat |> mutate(ctry = droplevels(ctry)),
  ordmod_site,
  outcome = "out_dafv",
  vars = c("agegte60", "sexF", "supp_oxy2", "crp_tertile", "ctry"),
  beta_sd_var = c(2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 1),
  intercept = FALSE
)
names(res$drws$AOR) <- "Nafamostat"
names(res$drws$COR) <- intervention_labels2()$CAssignment[-(1:2)]
names(res$drws$OR) <- c("Age \u2265 60", "Female", "Required oxygen", "CRP (2nd tertile)", "CRP (3rd tertile)", "CRP (unknown)", "Nepal")
Odds ratio summary table
save_tex_table(
  odds_ratio_summary_table_rev(c(res$drws$AOR, res$drws$COR, res$drws$OR), "latex"),
  "outcomes/secondary/7-5-primary-model-avs-itt-summary-table-pre-spec")
odds_ratio_summary_table_rev(c(res$drws$AOR, res$drws$COR, res$drws$OR))
Parameter Median 95% CrI Mean (SD) Pr(OR > 1)
Nafamostat 2.86 (0.85, 10.30) 3.52 (2.57) 0.96
Intermediate-dose 1.46 (0.34, 6.48) 1.94 (1.70) 0.70
Low-dose with aspirin 1.23 (0.17, 9.71) 2.14 (3.08) 0.58
Therapeutic-dose 1.21 (0.21, 7.27) 1.84 (2.17) 0.58
Age ≥ 60 0.60 (0.14, 2.65) 0.80 (0.72) 0.24
Female 1.61 (0.43, 6.84) 2.11 (1.79) 0.76
Required oxygen 0.64 (0.12, 2.73) 0.84 (0.71) 0.29
CRP (2nd tertile) 0.42 (0.09, 1.85) 0.56 (0.50) 0.13
CRP (3rd tertile) 1.48 (0.28, 8.62) 2.22 (2.88) 0.68
CRP (unknown) 6.63 (0.38, 319.04) 45.87 (257.33) 0.89
Nepal 1.29 (0.21, 8.63) 2.05 (2.59) 0.61
Posterior summaries for model parameters (fixed-effects), AVS-ITT.
Code
p <- plot_or_densities(c(res$drws$AOR)) +
  labs(x = "Odds ratio (log scale)", y = "Comparison")
pth <- file.path("outputs", "figures", "outcomes", "primary", "7-5-primary-model-avs-itt-odds-ratio-densities-pre-spec.pdf")
ggsave(pth, p, width = 6, height = 2.5)
p

Figure 15: Posterior densities for odds ratio contrasts, AVS-ITT.
Odds ratio summary for epoch and site
p <- plot_site_terms(
  res$drws$gamma_site,
  factor(res$dat$region_by_site, 
         labels = c("Australia\nNew Zealand", "Nepal"))
)
pth <- file.path("outputs", "figures", "outcomes", "secondary", "7-5-primary-model-site-terms-avs-itt-pre-spec.pdf")
ggsave(pth, p, width = 6, height = 4.5)
p

Summary of epoch and site posterior odds ratios.

Reduced Model

  • excluding epoch, site, and country due to small sample size
Fit primary model - AVS-ITT
res <- fit_primary_model(
  avs_itt_nona_dat,
  ordmod0,
  outcome = "out_dafv",
  vars = c("agegte60", "sexF", "supp_oxy2", "crp_tertile"),
  beta_sd_var = c(2.5, 2.5, 2.5, 2.5, 2.5, 2.5),
  intercept = FALSE
)
names(res$drws$AOR) <- "Nafamostat"
names(res$drws$COR) <- intervention_labels2()$CAssignment[-(1:2)]
names(res$drws$OR) <- c("Age \u2265 60", "Female", "Required oxygen", "CRP (2nd tertile)", "CRP (3rd tertile)", "CRP (unknown)")
Odds ratio summary table
save_tex_table(
  odds_ratio_summary_table_rev(c(res$drws$AOR, res$drws$COR, res$drws$OR), "latex"),
  "outcomes/secondary/7-5-primary-model-avs-itt-summary-table")
odds_ratio_summary_table_rev(c(res$drws$AOR, res$drws$COR, res$drws$OR))
Parameter Median 95% CrI Mean (SD) Pr(OR > 1)
Nafamostat 2.50 (0.80, 8.26) 3.01 (2.04) 0.94
Intermediate-dose 1.49 (0.37, 5.88) 1.90 (1.54) 0.71
Low-dose with aspirin 1.58 (0.25, 11.37) 2.64 (3.69) 0.68
Therapeutic-dose 1.10 (0.21, 6.44) 1.65 (1.86) 0.55
Age ≥ 60 0.73 (0.21, 2.98) 0.95 (0.79) 0.32
Female 1.72 (0.50, 6.78) 2.22 (1.81) 0.80
Required oxygen 0.64 (0.13, 2.55) 0.82 (0.66) 0.27
CRP (2nd tertile) 0.40 (0.09, 1.58) 0.51 (0.41) 0.09
CRP (3rd tertile) 1.51 (0.30, 8.12) 2.19 (2.46) 0.69
CRP (unknown) 7.35 (0.50, 331.20) 56.77 (494.93) 0.92
Posterior summaries for model parameters (fixed-effects), AVS-ITT.
Code
p <- plot_or_densities(c(res$drws$AOR)) +
  labs(x = "Odds ratio (log scale)", y = "Comparison")
pth <- file.path("outputs", "figures", "outcomes", "primary", "7-5-primary-model-avs-itt-odds-ratio-densities.pdf")
ggsave(pth, p, width = 6, height = 2.5)
p

Figure 16: Posterior densities for odds ratio contrasts, AVS-ITT.

Treatment Only

Code
res <- fit_primary_model(
  avs_itt_nona_dat,
  ordmod0,
  outcome = "out_dafv",
  vars = NULL,
  beta_sd_var = NULL,
  intercept = FALSE
)
names(res$drws$AOR) <- "Nafamostat"
Odds ratio summary table
save_tex_table(
  odds_ratio_summary_table_rev(c(res$drws$AOR), "latex"),
  "outcomes/secondary/7-5-primary-model-avs-itt-summary-table-trt-only")
odds_ratio_summary_table_rev(c(res$drws$AOR))
Parameter Median 95% CrI Mean (SD) Pr(OR > 1)
Nafamostat 2.1 (0.72, 6.54) 2.49 (1.60) 0.91
Posterior summaries for model parameters (fixed-effects), AVS-ITT.
Code
p <- plot_or_densities(c(res$drws$AOR)) +
  labs(x = "Odds ratio (log scale)", y = "Comparison")
pth <- file.path("outputs", "figures", "outcomes", "primary", "7-5-primary-model-avs-itt-odds-ratio-densities-trt-only.pdf")
ggsave(pth, p, width = 6, height = 2.5)
p

Figure 17: Posterior densities for odds ratio contrasts.